<?php
$settings = array(
    'formId' => 'coreSettings',
    'form' => array(
        'method' => 'post',
        'class' => array(),
        'accept-charset' => 'utf-8',
        'role' => 'form',
        'ajax-submit' => '#main',
        'id' => 'coreSettings',
    ),
    'type' => array(
        'field' => 'string',
        'widget' => 'Select',
        'isLabel' => true,
        'access' => array(
            'addForm' => true,
            'editForm' => true,
        ),
        'minLength' => 1,
        'maxLength' => 11,
        'number' => 1,
        'addition' => true,
        'label' => '默认邮件发送方式',
        'options' => [
            'smtp' => 'SMTP代发',
            'mail' => '只用mail函数发送'
        ],
        'description' => '如果选用SMTP代发，必须设置SMTP配置',
        'error' => '',
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'from_email' => array(
        'label' => '默认发件人',
        'userOptions' => array(),
        'description' => '显示默认发出邮件的邮箱地址',
        'field' => 'email',
        'error' => '',
        'widget' => 'Email',
        'value' => 0,
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'from_name' => array(
        'label' => '默认发件人姓名',
        'userOptions' => array(),
        'description' => '',
        'field' => 'string',
        'error' => '',
        'widget' => 'Text',
        'value' => 0,
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'reply_to_email' => array(
        'label' => '答复邮件地址',
        'userOptions' => array(),
        'description' => '接收收件人答复的默认邮件地址',
        'field' => 'email',
        'error' => '',
        'widget' => 'Email',
        'value' => 0,
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'reply_to_name' => array(
        'label' => '默认收件人姓名',
        'userOptions' => array(),
        'description' => '接收收件人答复的默认邮件用户姓名',
        'field' => 'string',
        'error' => '',
        'widget' => 'Text',
        'value' => 0,
        'validate' => array(),
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'smtp' => array(
        'Group' => 'Group',
        'label' => 'SMTP相关设置',
        'userOptions' => array(),
        'error' => '',
        'description' => '',
        'field' => 'group',
        'widget' => 'Group',
        'group' => array(
            'smtp_secure ' => array(
                'label' => '加密方式',
                'userOptions' => array(),
                'description' => '',
                'field' => 'string',
                'error' => '',
                'widget' => 'Select',
                'value' => 0,
                'options' => array(
                    0 => '不加密',
                    'tls' => 'TLS加密',
                ),
                'validate' => array(),
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'smtp_host' => array(
                'label' => 'SMTP服务器',
                'userOptions' => array(),
                'description' => '',
                'field' => 'string',
                'error' => '',
                'widget' => 'Text',
                'value' => 0,
                'validate' => array(),
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'smtp_port' => array(
                'label' => 'SMTP服务器端口',
                'userOptions' => array(),
                'description' => '',
                'field' => 'number',
                'error' => '',
                'widget' => 'Text',
                'value' => 0,
                'validate' => array(),
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'smtp_user_name' => array(
                'label' => 'SMTP用户名',
                'userOptions' => array(),
                'description' => '登录SMTP服务器的用户名',
                'field' => 'string',
                'error' => '',
                'widget' => 'Text',
                'value' => 0,
                'validate' => array(),
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
            'smtp_password' => array(
                'label' => 'SMTP密码',
                'userOptions' => array(),
                'description' => '登录SMTP服务器的密码',
                'field' => 'string',
                'error' => '',
                'widget' => 'Text',
                'value' => 0,
                'validate' => array(),
                'attributes' => array(
                    'class' => 'form-control',
                ),
            ),
        ),
        'validate' => array(),
        'attributes' => array(),
        'required' => false,
    ),
    'settings' => array(
        'save' => 'config',
        'data' => 'm.core.config',
        'menuGroup' => array(),
        'module' => '系统',
        'title' => '设置',
        'description' => '系统相关设置',
    ),
);
